#!/usr/bin/env python
# -*- coding: utf-8 -*-
  
#
# setup.py
#
import os,os.path,string,sys
from glob import glob
from distutils.core import setup

DESCRIPTION = """
MyGarden was started as an exam project for the course 'Multimedia Programming in Python' at Stockholm University.
It's a simulation game where the player gets to grow different plants organically, tend to them and harvest.
Users can also add their own plants easily.

License: GPL v3.

http://www.limewoodmedia.com/
"""

# Include the data files
isfile = os.path.isfile
root = 'game/'
base_prefix = os.path.join('Games','MyGarden')
data_prefix = os.path.join(base_prefix,'game')
plants_prefix = os.path.join(base_prefix,'plants')

data_files = [
      (os.path.join(data_prefix, 'data'), filter(isfile, glob(root+'data/*'))),
      (os.path.join(data_prefix, 'data/anim'), filter(isfile,glob(root+'data/anim/*'))),
      (os.path.join(data_prefix, 'data/fonts'), filter(isfile,glob(root+'data/fonts/*'))),
      (os.path.join(data_prefix, 'data/images'), filter(isfile,glob(root+'data/images/*'))),
      (os.path.join(data_prefix, 'data/images/icons'), filter(isfile,glob(root+'data/images/icons/*'))),
      (os.path.join(data_prefix, 'data/images/weather'), filter(isfile,glob(root+'data/images/weather/*'))),
      (os.path.join(data_prefix, 'data/sounds'), filter(isfile,glob(root+'data/sounds/*'))),
      (os.path.join(data_prefix, 'theme'), filter(isfile,glob(root+'theme/*'))),
      (base_prefix, ['mygarden.bat','mygarden.ico']),
      (plants_prefix, filter(isfile,glob('plants/*'))),
      (os.path.join(base_prefix, 'doc'), ['doc/README', 'doc/MyGarden.pdf', 'doc/copyright'])
     ]
# Add plants
plants_src = "plants"
plants_dst = os.path.join('Games','MyGarden',plants_src)
for dir in os.listdir(plants_src):
    if os.path.isdir(os.path.join(plants_src,dir)):
        data_files.append((os.path.join(plants_prefix,dir), filter(isfile,glob(plants_src+"/"+dir+"/*"))))

setup(name="MyGarden",
      version = "1.1.0",
      license = "GPL-3+",
      author = "Joakim Lindskog",
      author_email = "limewoodmedia@jordefamn.se",
      url = "http://www.limewoodmedia.com",
      description = "A small-scale organic farming simulation game",
      long_description = DESCRIPTION,
      package_dir = {'': 'game'},
      packages = ['cocos', 'cocos.actions', 'cocos.audio', 'cocos.audio.pygame',\
                    'cocos.audio.SDL', 'cocos.layer', 'cocos.scenes', 'events',\
                    'game', 'gardenbase', 'kytten', 'plants', 'pyglet', 'pyglet.app',\
                    'pyglet.font', 'pyglet.gl', 'pyglet.graphics', 'pyglet.image',\
                    'pyglet.image.codecs', 'pyglet.media', 'pyglet.media.drivers',\
                    'pyglet.media.drivers.alsa', 'pyglet.media.drivers.directsound',\
                    'pyglet.media.drivers.openal', 'pyglet.text', 'pyglet.text.formats',\
                    'pyglet.window', 'pyglet.window.carbon', 'pyglet.window.win32',\
                    'pyglet.window.xlib', 'tools', 'util', 'weather'],
      data_files = data_files,
      scripts = ['scripts/win_postinst.py'],
      requires = ['python (>= 2.6, < 3.0)', 'pygame']
      )
